package main

import (
	"github.com/stackexchange/wmi"
	"log"
	"fmt"
)

func main() {
	fmt.Println(getDiskDrivers())
}

	func getDiskDrivers() uint8 {
		type Win32_DiskDrive struct {
			Caption      string
			Name         string
			DeviceID     string
			Model        string
			Index        int
			Partitions   int
			Size         int
			PNPDeviceID  string
			Status       string
			SerialNumber string
			Manufacturer string
			MediaType    string
			Description  string
			SystemName   string
		}

		var dst []Win32_DiskDrive

		query := wmi.CreateQuery(&dst, "")
		fmt.Println(query)
		if err := wmi.Query(query, &dst); err != nil {
			log.Println(err.Error())
			return 0
		}

		//for key, value := range dst {
		//	log.Println(fmt.Sprintf(`Disk%d: %v`, key+1, value))
		//}

		return uint8(len(dst))
	}
